<template>
    <div>
        <n-input size="large" :loading="props.loading" v-model:value="data" round :placeholder="props.placeholder" @keyup.enter="submit" @change="submit">
            <template #suffix>
                <i class="iconfont icon-search" @click="submit"></i>
            </template>
        </n-input>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
    // 传入的属性
    placeholder: {
        type: String,
        default: '文章的标题搜索'
    },
    loading: {
        type: Boolean,
        default: false
    },
    size: {
        type: String,
        default: 'medium'
    }
})
const data = ref('')
const $emit = defineEmits(['submit'])
const submit = () => {
    // 触发事件
    $emit('submit',data)
}
</script>

<style scoped>


</style>